namespace Demo {
    window.onload = () => {
        let className = "DemoSimple01";
        let pStr = location.search;
        //读取URL 参数ID , 作为
        if (pStr[0] == "?") {
            className = pStr.substring(1);
        }

        let canvs = document.getElementById("MyCanvas") as HTMLCanvasElement;
        let w = canvs.width;
        let h = canvs.height;
        let app = new RAYTRACING.Application(canvs, w, h);
        if ((Demo as any)[className] == null) {
            let info = `not find example of ${className}. `;
            console.error(info);
            alert(info);
            return;
        }

        //实例创建
        console.log("onload start!");
        let obj = new (Demo as any)[className]() as IDemo;
        obj.Init(app);
    };
}